<%@ page language="java" contentType="text/html; charset=windows-1255"
	pageEncoding="windows-1255"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<!-- RichFaces tag library declaration -->
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<body>
	<f:view>
		<%@include file="../inc/menu.inc" %>


		<style>
.top {
	vertical-align: top;
}

.info {
	height: 202px;
	overflow: auto;
}
</style>
		<h:form>
		<f:loadBundle basename="il" var="mes"/>
		 <h:outputText style="font-size:30;color:#680000" value="#{mes.menu_up_dpa}" />
             		    <br>
             		    <br>
			<h:panelGrid columns="2" columnClasses="top,top">
				<rich:fileUpload
					fileUploadListener="#{dpaUploadManagedBean.listener}"
					maxFilesQuantity="#{dpaUploadManagedBean.uploadsAvailable}"
					id="upload" immediateUpload="#{dpaUploadManagedBean.autoUpload}"
					acceptedTypes="xls, xlsx"
					allowFlash="#{dpaUploadManagedBean.useFlash}">
					<a4j:support event="onuploadcomplete" reRender="info" />
				</rich:fileUpload>
				<h:panelGroup id="info">
					<rich:panel bodyClass="info">
						<f:facet name="header">
							<h:outputText value="Uploaded Files Info" />
						</f:facet>
						<h:outputText value="No files currently uploaded"
							rendered="#{dpaUploadManagedBeann.size==0}" />
						<rich:dataGrid columns="1" value="#{dpaUploadManagedBean.files}"
							var="file" rowKeyVar="row">
							<rich:panel bodyClass="rich-laguna-panel-no-header">
								<h:panelGrid columns="2">

									<h:panelGrid columns="2">
										<h:outputText value="File Name:" />
										<h:outputText value="#{file.name}" />
										<h:outputText value="File Length(bytes):" />
										<h:outputText value="#{file.length}" />
										<h:outputText value="State:" />
										<h:outputText value="#{file.state}" />
									</h:panelGrid>

								</h:panelGrid>

							</rich:panel>
						</rich:dataGrid>

					</rich:panel>
					<a4j:commandButton value="Parse Files" id ="parseButton"
						action="#{dpaUploadManagedBean.pasreFiles }" reRender="info" onclick="this.disabled=true" oncomplete="document.getElementById('parseButton').disabled=false" />
					<rich:spacer height="3" />
					<br />
					<a4j:commandButton action="#{dpaUploadManagedBean.clearUploadData}"
						reRender="info, upload" value="Clear Uploaded Data"
						rendered="#{dpaUploadManagedBea.size>0}" />
				</h:panelGroup>
			</h:panelGrid>
		</h:form>

	</f:view>
</body>
</html>

